[id].vue 663 B

123456789101112131415161718192021222324252627282930
  1. <template>
  2. <main>
  3. <LayoutContainer>
  4. <UiLoadingPanel v-if="pending" />
  5. <div v-else>
  6. <LayoutParametersCycleEditForm :cycle="cycle" />
  7. </div>
  8. </LayoutContainer>
  9. </main>
  10. </template>
  11. <script setup lang="ts">
  12. import {useEntityFetch} from "~/composables/data/useEntityFetch";
  13. import Cycle from "~/models/Education/Cycle";
  14. const { fetch } = useEntityFetch()
  15. const route = useRoute()
  16. if (!route.params.id || isNaN(route.params.id as any)) {
  17. throw new Error('no id found')
  18. }
  19. const id: number = parseInt(route.params.id as string)
  20. const { data: cycle, pending } = fetch(Cycle, id)
  21. </script>
  22. <style scoped lang="scss">
  23. </style>